package com.lean.android.projecttemplate.ui.newpage

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.material3.Button
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.currentCompositeKeyHash
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import androidx.navigation.navOptions
import com.lean.android.ad.FeedAd


@Composable
fun NewPageScreen(navController: NavController) {
    Surface(
        color = Color.White
    ) {
        Column(
            modifier = Modifier.fillMaxSize(),
            verticalArrangement = Arrangement.Top,
            horizontalAlignment = Alignment.CenterHorizontally
        ) {
            Text(text = "I`m new page , welcome", fontSize = 30.sp)

            Spacer(modifier = Modifier.height(20.dp))

            Button(onClick = {
                navController.navigateToNewPage(navOptions {
                    restoreState = true
                })
            }) {
                Text(text = "New Page", fontSize = 20.sp)
            }

            Spacer(modifier = Modifier.height(20.dp))

            FeedAd(key = "NewPage_$currentCompositeKeyHash")

        }
    }


}